/**
 * 北京中流科技有限公司 版权所有
 * http://www.chinasoa.com.cn
 */
package cn.com.chinasoa.portlet.framework.sample;

import java.io.IOException;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;

import com.x4ee.soa.portal.framework.core.ActionConfig;
import com.x4ee.soa.portal.framework.core.ActionFilter;
import com.x4ee.soa.portal.framework.core.BaseRequestFilter;

/**
 * @author 刘洋(liuyang@chinasoa.com.cn)
 * 2007-10-18下午02:34:23
 */
public class SayHelloActionFilter extends BaseRequestFilter implements ActionFilter {

	private static String SUCCESS = "success";
	private static String FAILED = "failed";

	public String process(ActionRequest actionRequest, ActionResponse actionResponse, ActionConfig actionConfig) 
		throws PortletException, IOException {
		String name = actionRequest.getParameter("name");
		if(name!=null){
			actionResponse.setRenderParameter("name",name);
			return SUCCESS;
		}else{
			return FAILED;
		}
	}

}
